package com.itcast.mallapplet.mapper;

import com.itcast.admin.entity.Seckill;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SeckillMapper {

    //根据id查询单个秒杀商品
    @Select("select * from seckill where id = #{id} and status = 1")
    Seckill seckillQuery(Long id);

    //查询全部秒杀商品
    @Select("select * from seckill where status = 1")
    List<Seckill> seckillQueryAll();

    //修改秒杀商品数量
    void seckillUpdate(Seckill seckill);
}
